package com.example.flowableoa.dubbo;


import com.example.comment_oa.dubbo.QiDongFuLiLiuChengDubbo;
import com.example.flowableoa.factory.FlowServiceFactory;
import com.example.flowableoa.service.IFlowInstanceService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Slf4j
@DubboService(version = "1.0.0",protocol = "${dubbo.protocol.id}",
        application = "${dubbo.application.id}",registry = "${dubbo.registry.id}",
        timeout = 3000)
public class QiDongFuLiLiuChengImpl  implements QiDongFuLiLiuChengDubbo {

    @Resource
    IFlowInstanceService iFlowInstanceService;

    @Override
    public void staterProcessInstanceById(String GongHao, Map<String, Object> variables, String assignee1, String fulibianhao) {
        iFlowInstanceService.staterProcessInstanceById( GongHao, variables,  assignee1,  fulibianhao);
    }


//    @Override
//    public void staterProcessInstanceById(String GongHao, Map<String, Object> variables,String assignee1,String fulibianhao) {
//        identityService.setAuthenticatedUserId(GongHao);
//
//        try {
//            String procDefId = "公司福利流程:1:65035a2d-6a5b-11ed-8a2f-8c8caad3480b";
//
//            variables.put("assignee1",assignee1);
//            variables.put("FuLiBianHao",fulibianhao);
//            runtimeService.startProcessInstanceById("公司福利流程:1:65035a2d-6a5b-11ed-8a2f-8c8caad3480b",variables);
//            log.info("流程启动成功:procDefId:{}",procDefId);
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//
//    }
}
